<%! public boolean loginedIn = false; %>
<% String name = request.getParameter("username");
	String password = request.getParameter("password");
	if(! (name.equals("admin") && password.equals("adminpwd") ) ) {
		name = "";
		password = "";
		loginedIn = false;
	} else {
		loginedIn = true;
	}
%>

<html>
<head>
<title>Using GET and POST method to Read Form Data</title>
</head>
<body>
	<div style="text-align: center">
		<h1>Using GET method to Read Form Data</h1>
		<ul>
			<%
				if(loginedIn) {
					out.println("<p>login successfully</p>");
					out.print("<li><p><b>Username:</b>" +
						name + 
						"</p></li><li><p><b>Password:</b>" + 
						password +
						"</p></li>");
				} else {
					out.println("<p>incorrect username and/or password</p>");
				}%>
		</ul>
	</div>
</body>
</html>
